package asapIs134CK.womi.client.games.logoGame.utils;

import asapIs134CK.womi.client.games.logoGame.froggitTheFrog.FroggitMyFrog;

/**
 * utility class representing the position of an object (used by {@link FroggitMyFrog})
 * @author LeoJ
 *
 */
public class Position {
	private int _x;
	private int _y;
	
	public Position(int x, int y){
		_x = x; _y = y;
	}
	public Position(Position position){
		_x = position._x;
		_y = position._y;
	}
	
	public int getX(){return _x;}
	public int getY(){return _y;}
	
	
	public boolean equals(Object arg0) {
		boolean isEquals = false;
		if (arg0 instanceof Position) {
			Position pos = (Position) arg0;
			if(pos._x == this._x && pos._y == this._y){
				isEquals = true;
			}
		}
		
		return isEquals;
	}
	public void setX(int i){
		_x = i;
	}
	public void setY(int i){
		_y = i;
	}
	
	public boolean isEquals(int x, int y){
		return _x == x && _y == y;
	}
	
	/*@Override
	protected Object clone() throws CloneNotSupportedException {
		try {
			return new Position(_x, _y);
		} catch (ValueException e) {
			e.printStackTrace();
			throw new CloneNotSupportedException();
		}
	}*/
	
	@Override
	public String toString() {
		return "("+_x+","+_y+")";
	}
}
